<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    let obj = [1, 2, 4, 5];
    let obj1 = JSON.parse(JSON.stringify(obj));
    console.log(obj1)
    function deepCopy(src, r) {
        var r = r || {};
        for (var prop in src) {
            if (typeof src[prop] === 'object') { 
                if (src[prop].constructor === Array) {
                    r[prop] = [];
                } else {
                    r[prop] = {};
                }
                deepCopy(src[prop], r[prop]);
            } else {
                r[prop] = src[prop];
            }
        }
        return r;
    }
    var arr1 = [[1, 2], [0, 3, 5], [-1, 4]];
    arr1 = arr1.flat().sort((a, b) => {
        return a - b
    });
    console.log(arr1)
</script>

</html>